import { defineComponent } from 'vue';

export interface MenuListResult {
  data: Array<RouteItem>;
  list: Array<RouteItem>;
  user: any;
}

export type Component<T = any> =
  | ReturnType<typeof defineComponent>
  | (() => Promise<typeof import('*.vue')>)
  | (() => Promise<T>);

export interface RouteItem {
  path: string;
  name: string;
  component?: Component | string;
  components?: Component;
  redirect?: string;
  meta?: RouteMeta;
  children?: Array<RouteItem>;
}

// id "663855492212641792"
// key "663855492212641792"
// menuCode "admin"
// parentId "0"
// title "系统管理"
// value "663855492212641792"

export interface RouteMeta {
  title: string;
  icon?: string;
  expanded?: boolean;
  orderNo?: number;
  hidden?: boolean;
  hiddenBreadcrumb?: boolean;
  single?: boolean;
  keepAlive?: boolean;
  frameSrc?: string;
  frameBlank?: boolean;
}
